package cn.lyp.feignclient;

import cn.lyp.domain.User;
import feign.hystrix.FallbackFactory;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

@Component
public class UserFeignFallBackFactory implements FallbackFactory<IUserFeignClient> {
    @Override
    public IUserFeignClient create(Throwable throwable) {
        throwable.printStackTrace();
        return id -> new User(id,"网络异常");
    }
}
